import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    redirect:{
      name:'index',
    }
  },
  {
    path:'/Login',
    name:'Login',
    component: () => import('../views/Login.vue')
  },
  {
    path:'/index',
    name:'index',
    component: () => import("../views/index.vue"),
    redirect:'/index/filmList',
    children:[{
      path:'filmList',
      name:'filmList',
      component: () => import("../components/filmManage/FilmList.vue")
    },
    {
      path:'filmArrangement',
      name:'filmArrangement',
      component:() => import("../components/filmManage/filmArrangement.vue")
    },{
      path:'addFilm',
      name:'addFilm',
      component:() => import("../components/filmManage/addFilm.vue")
    },{
      path:'filmCarousel',
      name:'filmCarousel',
      component:() => import("../components/filmManage/filmCarousel.vue")
    },{
      path:'userList',
      name:'userList',
      component:() => import("../components/userManage/userList.vue")
    },{
      path:'orderList',
      name:'orderList',
      component:() => import("../components/orderManage/orderList.vue")
    },{
      path:'errorOrder',
      name:'errorOrder',
      component:() => import("../components/orderManage/errorOrder.vue")
    },{
      path:'empList',
      name:'empList',
      component:() => import("../components/employeeManage/empList.vue")
    },{
      path:'empAdd',
      name:'empAdd',
      component:() => import("../components/employeeManage/empAdd.vue")
    },{
      path:'baseSetting',
      name:'baseSetting',
      component:() => import("../components/BaseSetting.vue")
    }
  ]
  },
  {
    path:'/success',
    name:'success',
    component:() => import("../components/success.vue")
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  linkExactActiveClass: "active",
  routes
})

export default router
